package com.test.common;

import lombok.Data;

import java.text.DecimalFormat;

@Data
public class ProcessInfo {

    private int itemNum;
    private double readSizeMB;
    private double totalSizeMB;
    private double percent;

    public void updatePercent() {
        this.percent = Double.parseDouble(new DecimalFormat("#.00").format(this.readSizeMB / this.totalSizeMB * 100));
    }

    @Override
    public String toString() {
        return "ProcessInfo{" +
                "itemNum=" + itemNum +
                ", readSizeMB=" + readSizeMB +
                ", totalSizeMB=" + totalSizeMB +
                ", percent=" + percent +
                '}';
    }
}
